package com.wc.AlgoOJ.LQ1148T_排水管道;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/13 22:14
 * @description http://43.138.190.70:8888/p/LQ1148T
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static int[] a = new int[N];
    static int[] b = new int[N];
    static int lenB = 0;
    static int lenA = 0;
    static int n;

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if (i + x >= n) {
                a[++lenA] = i + x;
            }
        }
        b[0] = Integer.MAX_VALUE;
        for (int i = 1; i <= lenA; i++) {
            if (a[i] <= b[lenB]) {
                b[++lenB] = a[i];
            } else {
                b[find(a[i])] = a[i];
            }
        }
        out.println(n - lenB);
        out.flush();
    }

    static int find(int x) {
        int l = 1, r = lenB;
        while (l < r) {
            int mid = l + r >> 1;
            // 寻找第一个大于x的值
            if (x > b[mid]) r = mid;
            else l = mid + 1;

        }
        return r;
    }

}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}
